<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<script type="text/javascript">
	$("#four").click(function() {
	
		var form01=$("#biao");
// 		var login_phone = $(this).parent().find("#fir").val();
// 		var login_pwd = $(this).parent().find("#sed").val();
		var login_phone = form01.find("#fir").val();
		var login_pwd = form01.find("#sed").val();
		
		
// 		alert(login_phone);
// 		alert(login_pwd);
		
		
		
		login_pwd = login_phone + login_pwd + login_phone;
		
		login_pwd = $.md5(login_pwd);

		var json = {
			"login_phone" : login_phone,
			"login_pwd" : login_pwd
		};
		$.ajax({
			type : 'post',
			url : '/GDZjiajiaowang/LoginServlet',
			data : json,
			datatype : 'json',
			success : function(data) {
				if (3 == data) {
					$("#loginNow_div").hide();
					loggedin(3, 0, "admin");
					location.href = "/GDZjiajiaowang/GoAdminPageServlet";
					$("#loginNotSuccess").hide();
				} else if (data.realName!=null) {
					$("#loginNow_div").hide();
					alert("老师登录成功")
					loggedin(2, data.id, data.realName);
					$("#loginNotSuccess").hide();
					
				} else if (data.studentName!=null) {
					alert("学生登录成功")
					$("#loginNow_div").hide();
					loggedin(1, data.studentId, data.studentName);
					$("#loginNotSuccess").hide();
				} else {
					alert("登录失败")
					$("#loginNotSuccess").show();
				}
			}
		})
	})
</script>